<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%>
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic"%>
<%@ taglib prefix="nested" uri="http://struts.apache.org/tags-nested"%>
<%java.util.List <domain.ContactGroup> books = (java.util.List <domain.ContactGroup>)request.getAttribute("books");%>
<!DOCTYPE html> 
<html:html>
<head>
<title><bean:message key="addContact.title" /></title>
<jsp:include page="/pages/header.jsp" />
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="span12">
				<div class="page-header">
					<h1>
						<bean:message key="addContact.title" />
					</h1>
				</div>
			</div>
		</div>
		<div class="row">
			<jsp:include page="/pages/navbar.jsp" />
			<div class="span10">
		<html:errors/>
		<html:form action="/addContact" styleClass="well" styleId="formulaire">
			<table id="contact">
				<tr>
					<td><label><bean:message key="firstNameLabel" /></label></td><td><html:text property="firstname"/></td>
				</tr>
				<tr>
					<td><label><bean:message key="lastNameLabel" /></label></td><td><html:text property="lastname"/></td>
				</tr>
				<tr>
					<td><label><bean:message key="emailLabel" /></label></td><td><html:text property="email"/></td>
				</tr>
				<tr>
					<td><label><bean:message key="streetLabel" /></label></td><td><html:text property="street"/></td>
				</tr>
				<tr>
					<td><label><bean:message key="cityLabel" /></label></td><td><html:text property="city"/></td>
				</tr>
				<tr>
					<td><label><bean:message key="zipLabel" /></label></td><td><html:text property="zip"/></td>
				</tr>
				<tr>
					<td><label><bean:message key="countryLabel" /></label></td><td><html:text property="country"/></td>
				</tr>
				<tr>
					<td><label><bean:message key="numPhoneMobileLabel" /></label></td><td><html:text property="numPhoneMobile"/></td>
				</tr>
				<tr>
					<td><label><bean:message key="numPhoneHomeLabel" /></label></td><td><html:text property="numPhoneHome"/></td>
				</tr>
				<tr>
					<td><label><bean:message key="numPhoneDesktopLabel" /></label></td><td><html:text property="numPhoneDesktop"/></td>
				</tr>
				<tr>
				<td><label><bean:message key="booksLabel" /></label></td>
				<td>
				<table id="books">
				<%if(books != null){
					for(domain.ContactGroup book : books){
						%><tr><td><label class="checkbox"><html:checkbox property="books" value="<%=book.getGroupName()%>"/><%=book.getGroupName()%></label></td></tr><%
					}
				}%>
				<tr>
				<td>
				<button id="btnShowSimple" name="btnShowSimple" class="btn btn-info"><i class="icon-white icon-plus-sign"></i>&nbsp;<bean:message key="addBookButton" /></button>
				</td>
				</tr>
				</table>
				<tr><td><label><bean:message key="companyLabel" /></label></td><td><label class="checkbox"><html:checkbox styleId="company" property="company" value="1"/></label></td></tr>
			</table>				
			<button type="submit" name="submitButton" class="btn btn-success"><i class="icon-white icon-ok-sign"></i>&nbsp;<bean:message key="submitButton" /></button>
			<button type="reset" name="resetButton" class="btn btn-danger" id="resetBtn"><i class="icon-white icon-remove-sign"></i>&nbsp;<bean:message key="resetButton" /></button><br/>
		</html:form>
			</div>
		</div>
		<jsp:include page="/pages/footer.jsp" />
	</div>
</body>
</html:html>